import {WidgetClass} from "../atom/widget";

export class MeetingListFunction extends WidgetClass {
  constructor(options = {}) {
    super(options);
    const {ports, UI} = options;
    if (UI) {
      this.UI.data = UI.data;
    } else {
      this.UI.data = {
        componentColor: "bg-color-container",
        textColor: "text-color-primary",//大标题
        thirdTextColor: "text-color-placeholder",//时间。人
        secondaryTextColor: "text-color-secondary",//时间。人
        tagColor1: "bg-component",
        tagColor2: "brand-color",
        tagColor3: "success-color",
        antiTextColor: "text-color-anti",
        disableTextColor: "text-color-disabled",
      };
    }
    if (ports) {
      this.ports = ports;
    } else {
      this.ports = this.assembleDefaultPorts();
    }
  }

  assembleDefaultPorts() {
    const superState = super.assembleDefaultPorts();
    return {
      ...superState,
      values: [
        ...superState.values,
        {
          name: "会议号码",
          key: "meetingNum",
          type: "string",
          value: "1",
        },
        {
          name: "会议密码",
          key: "password",
          type: "string",
          value: "c1",
        },
        {
          name: "会议类型",
          key: "meetingType",
          type: "string",
          value: "panUp",
        },
      ],
      events: [
        ...superState.events,
        {
          name: "入会",
          key: "joinMeeting",
          eventType: "custom",
          type: "event",
          action: [],
        }
      ],
    };
  }
}
